<!DOCTYPE html>
<html>
<body>
<div contenteditable title="1: last visible position" style="word-wrap: break-word; width: 10ex; border: solid thin black;"><span style="white-space:pre">	</span></div>
<div contenteditable title="0: first visible position" style="word-wrap: break-word; width: 10ex; border: solid thin black;"><span style="white-space:pre">	</span></div>
<div contenteditable title="1: before tab span" style="word-wrap: break-word; width: 10ex; border: solid thin black;">hi, <span style="white-space:pre">	</span> rocks</div>
<div contenteditable title="2: after tab span" style="word-wrap: break-word; width: 10ex; border: solid thin black;">hi, <span style="white-space:pre">	</span> rocks</div>
<script src="../../resources/dump-as-markup.js"></script>
<script>

Markup.description('This test ensures WebKit avoids cloning Apple tab span when inserting a paragraph separator.\n'+
    'Only tab should be inside a Apple tab span in the following tests.');

function runTest(div) {
    var offset = div.title.substr(0, div.title.indexOf(':'));
    window.getSelection().collapse(div, offset);
    document.execCommand("InsertParagraph");
    document.execCommand("InsertText", false, "hello world WebKit ");
    Markup.dump(div, div.title.substr(div.title.indexOf(': ') + 2));
}

var divs = document.getElementsByTagName('div');
var tests = new Array();
for (var i = 0; i < divs.length; i++)
    tests.push(divs[i]);

for (i in tests)
    runTest(tests[i]);

</script>
</body>
</html>
